<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>{{ title }}</h1>
<hr>
<h2>列表数据操作</h2>
<p>{{ name_list }}</p>
<p>{{ name_list.0 }}</p>
<p>{{ name_list.1 }}</p>
<p>{{ name_list.2 }}</p>
<p>{{ name_list.3 }}</p>
<hr>
<h2>字典类型数据操作</h2>
<p>{{ user }}</p>
<p>{{ user.username }}</p>
<p>{{ user.email }}</p>
<p>{{ user.password }}</p>

<hr>
<h2>列表嵌套字典类型数据操作</h2>
<ul>
    <li>{{ users.0.username }}</li>
    <li>{{ users.0.email }}</li>
    <li>{{ users.0.password }}</li>
</ul>

<ul>
    <li>{{ users.1.username }}</li>
    <li>{{ users.1.email }}</li>
    <li>{{ users.1.password }}</li>
</ul>

<ul>
    <li>{{ users.2.username }}</li>
    <li>{{ users.2.email }}</li>
    <li>{{ users.2.password }}</li>
</ul>
<hr>
<h2>列表的遍历</h2>
{% for name in name_list %}
    <p>{{ name }}</p>
{% endfor %}
<hr>
<h2>遍历字典</h2>
{% for attr,val in user.items %}
    <p>{{ attr }}--{{ val }}</p>
{% endfor %}

<hr>
<h2>遍历列表中嵌套的字典</h2>
<table border="1" width="80%" cellspacing="0">
    <tr>
        <th>用户名</th>
        <th>密码</th>
        <th>邮箱</th>
    </tr>
    {% for user in users %}
        <tr>
            <td>{{ user.username }}</td>
            <td>{{ user.password }}</td>
            <td>{{ user.email }}</td>
        </tr>
    {% endfor %}

</table>

<button>查询</button>
{% if status == 1 %}
    <button>新增</button>
{% elif status == 2 %}
    <button>删除</button>
{% elif status == 3 %}
    <button>修改</button>
{% else %}
    <button>普通按钮</button>
{% endif %}


<br><br><br><br>

</body>
</html>